/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 亮色主题变量 */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --footer-bg: #ffffff;
}

/* 暗色主题变量 */
.dark {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --border-color: #374151;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --card-bg: #1f2937;
  --header-bg: #1f2937;
  --footer-bg: #1f2937;
}

/* 基础布局样式 */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 卡片样式 */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px var(--shadow-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 头部样式 */
header {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 底部样式 */
footer {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 进度条暗色模式适配 */
.dark .ant-progress-line {
  background-color: #374151;
}

.dark .ant-progress-text {
  color: #d1d5db;
}

/* 表格暗色模式适配 */
.dark .ant-table {
  background-color: var(--card-bg);
  color: var(--text-primary);
}

.dark .ant-table-thead > tr > th {
  background-color: #374151;
  color: var(--text-primary);
  border-bottom-color: #4b5563;
}

.dark .ant-table-tbody > tr > td {
  border-bottom-color: #4b5563;
}

.dark .ant-table-tbody > tr:hover > td {
  background-color: #374151;
}

/* 选择器暗色模式适配 */
.dark .ant-select:not(.ant-select-customize-input) .ant-select-selector {
  background-color: #374151;
  border-color: #4b5563;
  color: var(--text-primary);
}

.dark .ant-select-arrow {
  color: var(--text-secondary);
}

/* 标签页暗色模式适配 */
.dark .ant-tabs-tab {
  color: var(--text-secondary);
}

.dark .ant-tabs-tab-active {
  color: var(--text-primary);
}

.dark .ant-tabs-ink-bar {
  background-color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .grid-cols-1 {
    grid-template-columns: 1fr;
  }

  .lg\:col-span-5,
  .lg\:col-span-7 {
    grid-column: span 12;
  }
}

/* 布局样式 */
.ant-layout {
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.ant-layout-sider {
  box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
}

.ant-layout-header {
  padding: 0 24px;
  background-color: var(--header-bg) !important;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  transition: background-color 0.3s ease;
}

/* 侧边栏菜单样式 */
.ant-menu {
  border-right: none;
  background-color: var(--card-bg) !important;
  color: var(--text-primary) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.ant-menu-item {
  margin: 4px 8px;
  border-radius: 6px;
}

.ant-menu-item-selected {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.ant-menu-item:not(.ant-menu-item-selected):hover {
  background-color: var(--bg-secondary) !important;
}

/* 顶部导航栏样式 */
.topbar-user-dropdown {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.topbar-user-dropdown:hover {
  background-color: #f5f5f5;
}

/* 内容区域样式 */
.ant-layout-content {
  padding: 24px;
  margin: 0;
  min-height: calc(100vh - 64px);
  background-color: var(--bg-primary) !important;
  transition: background-color 0.3s ease;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .ant-layout-sider {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
  }

  .ant-layout {
    margin-left: 0 !important;
  }

  .ant-layout-header {
    padding: 0 16px;
  }

  .topbar-user-dropdown span {
    display: none;
  }
}

/* 侧边栏样式 */
.main-sidebar {
  background-color: var(--card-bg) !important;
  transition: background-color 0.3s ease;
}

.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
  color: var(--text-primary);
}

.sidebar-menu {
  background-color: var(--card-bg) !important;
  color: var(--text-primary) !important;
}

/* 顶部栏头部样式 */
.topbar-header {
  background-color: var(--header-bg) !important;
  color: var(--text-primary) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 内容区域样式 */
.layout-content {
  background-color: var(--bg-primary) !important;
  transition: background-color 0.3s ease;
}
